package com.stu.spring.sim.circular;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor;

public class JdkProxyBeanPostProcessor implements SmartInstantiationAwareBeanPostProcessor {

    @Override
    public Object getEarlyBeanReference(Object bean, String beanName) throws BeansException {
        if(bean instanceof IAService){
            JdkDynamicProxy jdkDynamicProxy = new JdkDynamicProxy();
            return jdkDynamicProxy.getInstance(bean);
        }
        return bean;
    }
}
